#ifndef _DMAAPI_H
#define _DMAAPI_H


typedef enum {
    DMA_BURST_8_BYTES,
    DMA_BURST_16_BYTES,
    DMA_BURST_32_BYTES
}BURST_SIZE_E;

typedef enum {
    DMA_BUS_WIDTH_1_BYTE,
    DMA_BUS_WIDTH_2_BYTE,
    DMA_BUS_WIDTH_4_BYTE
}BUS_WIDTH_E;

typedef struct DMA_INIT_PARAMS_S{
    DWORD            flags;
    DWORD            dmaReq;
    BURST_SIZE_E    burstSize;
    BUS_WIDTH_E        busWidth;
}DMA_INIT_PARAMS_ST;

#define DMA_CHOOSE_OWN_CHANNEL            -1
#define DMA_USE_POLLING_NO_INTERRUPT    -1

//flags for DMA_INIT_PARAMS_ST
#define DMA_USE_HW_FLOW_CTRL    1

typedef void (*DMA_CallBackF)(DWORD    transactionId, DWORD status);

typedef struct DMA_PARAMS_S 
{
    LPVOID            srcAddr;
    LPVOID            dstAddr;
    DWORD            len;
    DWORD            flags;
    DWORD            transactionId;
    DMA_CallBackF    callBack;
} DMA_PARAMS_ST ;

#define DMA_INC_SRC_ADDR            1
#define DMA_INC_DST_ADDR            2
#define DMA_USE_DST_FLOW_CONTROL    4
#define DMA_USE_SRC_FLOW_CONTROL    8


//Values for status
#define DMA_STATUS_OK        0
#define DMA_STATUS_ERR        -1

typedef LPVOID (*DMA_SetUpChannelF)(DMA_INIT_PARAMS_ST* userParams);
typedef void (*DMA_ConfigChannelF)(LPVOID dev, DMA_PARAMS_ST* dmaParam);
typedef void (*DMA_RemoveChannelF)(LPVOID dev);


#endif /*_DMAAPI_H*/